Second Order Equations: Variation of Parameters

Edmund Chiang
MATH2351 / 2352 — Boyce & DiPrima §3.6
February 20, 2026

1   A General Method

1.1   Motivation

We introduce an ultimate method dealing with non-homogeneous second order linear DEs. It is difficult to apply undetermined coefficients method to the DE

$$y'' + 4y = 3\csc t \quad (\csc t = 1/\sin t).$$

1.2   Example

Example. We modify the complementary function

$$y(t) = c_1\cos 2t + c_2\sin 2t,$$

for the homogeneous DE

$$y'' + 4y = 0$$

by

$$Y(t) = u_1(t)\cos 2t + u_2(t)\sin 2t,$$

where $u_1(t)$, $u_2(t)$ are now functions. Then

$$Y' = -2u_1(t)\sin 2t + 2u_2(t)\cos 2t + u_1'\cos 2t + u_2'\sin 2t.$$

We now demand

$$u_1'(t)\cos 2t + u_2'\sin 2t = 0. \tag{1}$$

Hence

$$Y'' = -4u_1\cos 2t - 4u_2\sin 2t - 2u_1'\sin 2t + 2u_2'\cos 2t.$$

Substitute the $Y'$ and $Y''$ into the DE yields

\begin{align} 3\csc t &= Y'' + 4Y \\ &= [-4u_1\cos 2t - 4u_2\sin 2t - 2u_1'\sin 2t + 2u_2'\cos 2t] + 4[u_1(t)\cos 2t + u_2(t)\sin 2t] \\ &= -2u_1'\sin 2t + 2u_2'\cos 2t. \end{align}

That is, we have

$$-2u_1'\sin 2t + 2u_2'\cos 2t = 3\csc t. \tag{2}$$

That is, the $u_1$, $u_2$ should satisfy the two equations (1) and (2). We deduce from (1) that

$$u_2' = -u_1'\frac{\cos 2t}{\sin 2t}. \tag{3}$$

Substitute this into (2) yields

\begin{align} 3\csc t &= -2u_1'\sin 2t - 2u_1'\frac{\cos 2t}{\sin 2t}\cos 2t \\ &= -2u_1'\frac{\sin^2 2t + \cos^2 2t}{\sin 2t} \\ &= -2u_1'\frac{1}{\sin 2t}. \end{align}

That is,

$$u_1'(t) = -\frac{3\csc t\sin 2t}{2} = -3\cos t,$$

Substitute this into (3) yields

$$u_2'(t) = \frac{3\cos t\cos 2t}{\sin 2t} = \frac{3(1 - 2\sin^2 t)}{2\sin t} = \frac{3}{2}(\csc t - 2\sin t) = \frac{3}{2}\csc t - 3\sin t.$$

Thus we deduce

$$u_1(t) = -3\sin t + c_1,$$

and

$$u_2(t) = \frac{3}{2}\ln|\csc t - \cot t| + 3\cos t + c_2,$$

where we have used the following result in a step above

$$\int \frac{dt}{\sin t} = \int \csc t\,dt = \ln|\csc t - \cot t| = \ln\Big|\tan\frac{t}{2}\Big|.$$

We finally have

\begin{align} Y &= u_1\cos 2t + u_2\sin 2t \\ &= (-3\sin t + c_1)\cos 2t + \Big(\frac{3}{2}\ln|\csc t - \cot t| + 3\cos t + c_2\Big)\sin 2t \\ &= -3\sin t\cos 2t + \frac{3}{2}\ln|\csc t - \cot t|\sin 2t + 3\cos t\sin 2t + c_1\cos 2t + c_2\sin 2t \\ &= 3\sin(2t - t) + \frac{3}{2}\ln|\csc t - \cot t|\sin 2t + c_1\cos 2t + c_2\sin 2t \\ &= 3\sin t + \frac{3}{2}\ln|\csc t - \cot t|\sin 2t + c_1\cos 2t + c_2\sin 2t. \end{align}

But the terms $c_1\cos 2t + c_2\sin 2t$ can be combined with the complementary function so that the last expression is the general solution to the original DE.


2   General Theory

2.1   The Formula

Theorem — Variation of Parameters

Let $p$, $q$, $g$ be continuous on an open interval $I$. Suppose $y_1$, $y_2$ are a fundamental set of solutions of the homogeneous DE

$$y'' + p(t)y' + q(t)y = g(t),$$

that is, when $g(t) \equiv 0$. Then particular integral to the DE is given by

$$Y(t) = -y_1(t)\int_{t_0}^t \frac{y_2(s)g(s)}{W(y_1, y_2)(s)}\,ds + y_2(t)\int_{t_0}^t \frac{y_1(s)g(s)}{W(y_1, y_2)(s)}\,ds$$

where $t_0$ belongs to $I$. The general solution is given by

$$y(t) = c_1 y_1(t) + c_2 y_2(t) + Y(t).$$

The set of $y_1$, $y_2$ is also known as complementary functions of the non-homogeneous equation.

2.2   Proof

Proof. Let $$Y = u_1 y_1 + u_2 y_2.$$

Then

$$Y' = u_1 y_1' + u_2 y_2' + (u_1' y_1 + u_2' y_2).$$

We demand the expression coloured in green to vanish identically:

$$u_1' y_1 + u_2' y_2 = 0. \tag{4}$$

That is,

$$Y' = u_1 y_1' + u_2 y_2'. \tag{5}$$

Hence

$$Y'' = u_1' y_1' + u_2' y_2' + u_1 y_1'' + u_2 y_1''.$$

Substitute the $Y'$ and $Y''$ into the DE and note that the blue expressions in blue and red in

\begin{align} g(t) &= y'' + p(t)y' + q(t)y(t) \\ &= u_2 y_1'' + u_1 y_2'' + u_1' y_1' + u_2' y_2' \\ &\quad + pu_1 y_1' + pu_2 y_2' \\ &\quad + qu_1 y_1 + qu_2 y_2 \\ &= 0 + 0 + u_1' y_1' + u_2' y_2' \tag{6} \end{align}

both vanish since $y_1$, $y_2$ is a fundamental set of solutions of the homogeneous DE. Multiplying $y_1'$ throughout the (4) and multiplying $y_1$ throughout the (6) yield

\begin{align} u_1' y_1 y_1' + u_2' y_2 y_1' &= 0 \\ u_1' y_1' y_1 + u_2' y_2' y_1 &= y_1 g. \end{align}

Subtracting the above equations yields

$$u_2' = \frac{y_1 g}{W(y_1, y_2)}.$$

Similarly we can deduce

$$u_1' = -\frac{y_2 g}{W(y_1, y_2)}.$$

Integrating the above two equations from a convenient point $t_0$ to $t$ results in the desired formula.


3   Examples

Example. Solve

$$y'' - 5y' + 6y = 2e^t.$$

A fundamental set of solutions is given by $\{e^{2t}, e^{3t}\}$. Thus

$$W(e^{2t}, e^{3t}) = \begin{vmatrix} e^{2t} & e^{3t} \\ 2e^{2t} & 3e^{3t} \end{vmatrix} = 3e^{5t} - 2e^{5t} = e^{5t}.$$

Hence

\begin{align} Y &= -e^{2t}\int_{t_0}^t \frac{e^{3t}(2e^t)}{e^{5t}}\,dt + e^{3t}\int_{t_0}^t \frac{e^{2t}(2e^t)}{e^{5t}}\,dt \\ &= -e^{2t}\int_{t_0}^t 2e^{-t}\,dt + e^{3t}\int_{t_0}^t 2e^{-2t}\,dt \\ &= 2e^t - 2/2 \cdot e^{(3-2)t} \\ &= e^t. \end{align}

We could have used the method of undetermined coefficients method learnt from the last section to solve this DE.


4   Exercises

Exercise — Variation of Parameters

Use the method of variation of parameters to solve each of the following.

  1. $y'' - 5y' + 6y = 2e^t$ $c_1 e^{2t} + c_2 e^{3t} + e^t$
  2. Find a particular solution to $y'' - y' - 2y = 2e^{-t}$ $-\frac{2}{3}te^{-t}$
Exercise — General Solution

Solve for the general solution of the following DEs.

  1. $y'' - 4y' + 4y = t^{-2}e^{-2t}$ $c_1 e^{-2t} + c_2 te^{-2t} - e^{-2t}\ln t$
  2. $y'' + y = \tan t$ $c_1\cos t + c_2\sin t + \cos t\ln\frac{\cos\frac{t}{2} - \sin\frac{t}{2}}{\cos\frac{t}{2} + \sin\frac{t}{2}}$
  3. $4y'' + y = 2\sec t/2$ $(|t| < \pi)$ $c_1\cos t/2 + c_2\sin t/2 + t\sin t/2 + 2[\ln\cos t/2]\cos t/2$
  4. $y'' - 5y' + 6y = g(t)$ where the $g(t)$ is an arbitrary continuous function. $c_1 e^{2t} + c_2 e^{3t} + \frac{1}{2}\int[\sin 2(t-s)]g(s)\,ds$

5   Practice MCQ

Practice: Variation of Parameters

Use variation of parameters to find a particular solution to:

$$y'' - 5y' + 6y = 2e^t$$

Given: complementary functions are $y_1 = e^{2t}$, $y_2 = e^{3t}$.

PHASE 0 Compute the Wronskian

What is $W(y_1, y_2) = W(e^{2t}, e^{3t})$?

Now apply the variation of parameters formula...
PHASE A Set Up the Integrals

By the formula, $u_1' = -\dfrac{y_2 g}{W}$. With $g = 2e^t$, what is $u_1'$?

Similarly, $u_2' = \dfrac{y_1 g}{W}$. What is $u_2'$?

Now integrate to find $u_1$ and $u_2$...
PHASE B Compute the Particular Solution
Step B1

Integrate $u_1' = -2e^{-t}$ to get $u_1$:

Step B2

Integrate $u_2' = 2e^{-2t}$ to get $u_2$:

Step B3

The particular solution is $Y = u_1 y_1 + u_2 y_2 = 2e^{-t} \cdot e^{2t} + (-e^{-2t}) \cdot e^{3t}$:

Excellent! The particular solution is $Y(t) = e^t$.